A unified, privacy-hardened wellness platform bridging clinical mental health diagnostics, daily stress-reduction tools, and automated multi-agent wellness reporting. Engineered with a Next.js 15 web application and an Expo 54 React Native mobile app, designed for personal growth and B2B corporate employee benefits.
BODH: Beyond Noise was engineered to solve the fragmentation of wellness apps by unifying clinical mental health diagnostics, daily stress-reduction rituals, and robust corporate B2B deployment features. By connecting a Next.js 15 web portal and an Expo 54 React Native mobile app under a shared identity and data layer, BODH provides a seamless, professional-grade platform.
A core pillar of BODH is its **B2B Offline Setup** designed for future corporate employee benefits. Designed for highly-regulated or low-connectivity enterprise environments, BODH bundles local screening tests, interactive breathing guides, and encrypted journals directly inside the application. Employees can perform diagnostics and stress-reduction routines entirely offline. No sensitive mental health data ever traverses corporate networks or leaves the user's device, ensuring absolute confidentiality and data security.
The "Report in 60 Seconds" Assessment Pipeline
BODH replaces lengthy manual consultations with an automated, high-speed diagnostic engine. Users take standardized clinical mental health and behavioral screenings, including:
GAD-7 (Generalized Anxiety Disorder) screening
PHQ-9 (Patient Health Questionnaire for depression)
PSS (Perceived Stress Scale) evaluation
ADHD clinical screening
Diagnostic Pipeline Flow (Under 60 Seconds)
Intake: User completes a 5-minute clinical and cognitive questionnaire in the web portal or mobile app.
Edge scoring: Client-side logic grades responses and sends anonymized parameters securely to Next.js API routes.
Rate Limit Check: API uses Upstash Redis sliding-window rate-limiting (10 queries/hour cap for AI runs) to prevent token abuse.
Parallel CrewAI Analysis: Background worker launches a parallel agent team (Data Analyst, Wellness Advisor, Community Researcher) running Gemini 1.5 Flash/Pro models to extract statistical correlations, longitudinal velocity, and coaching schedules.
Delivery: The report generator compiles outputs into a structured database-cached record and renders a downloadable high-fidelity PDF summary in under 60 seconds.
The Creative Showcase: UI Bento & Sound Lab
BODH balances rigorous technical security with a soothing, high-fidelity visual and auditory user experience:
Consciousness-First UI: Custom bento-style layouts styled with dark olive-green brand themes (`#3D6B35`), clean typography, and an ergonomic floating navigation bar with subtle haptic feedback triggers.
Meditation & Breathwork Lab: An immersive audio playback engine utilizing expo-audio playing curated sessions recorded at 432Hz and 528Hz Solfeggio healing frequencies.
Physics-Based Animation: Visual breathwork coaches utilizing react-native-reanimated v4 that scale and pulse to guide breathing, using explicit unmount cancellation hooks to prevent device CPU spikes and memory leaks.
Local Offline Packages: A pre-bundled suite of breathwork sessions, audio guides, and journaling tools, enabling employees to practice wellness rituals in remote areas or high-security offline corporate zones.
Secure Mobile Architecture & Telemetry Scrubber Flow
Full Stack Architecture : All 4 Tiers
Telemetry Log Sanitizer Simulator
Input a raw application log payload containing sensitive user keys (e.g. Authorization token, email, medicalConditions). Click "Sanitize Log Output" to see how the recursive logger redacts PII before sending metrics.
Click button to run sanitization filter...
Interactive Architecture Explorer
Click any architectural block to inspect security implementations, code structures, and trade-offs made to protect this live application.
Under the Hood: CrewAI Wellness Analytics Workflow
BODH operates a multi-agent CrewAI parallel workflow running via Gemini 1.5 Flash and Pro models to process user diagnostic metrics and generate comprehensive, B2B-compliant wellness plans:
Wellness Data Analyst : Identifies multivariate correlations across assessments and meditation history, calculates longitudinal velocity (rate of wellness score change), and performs anomaly/outlier detection.
Personalized Wellness Advisor : Conducts behavioral mapping, drafts an optimal 24-hour daily ritual schedule, and aligns daily coaching recommendations to the user's specific goals.
Community Wellness Researcher : Evaluates user engagement against global cohorts, runs demographic peer benchmarking, and designs a personalized 21-day social accountability challenge protocol.
Report Synthesis Director : Acts as the Editor-in-Chief to resolve discrepancies, generate a structured Executive Summary, select the top 3 high-impact actionable habits, and format the output into responsive email and downloadable PDF layouts.
Architectural Retrospective
Parallel Execution Optimization: Initially, CrewAI agents were called sequentially, taking over 45 seconds and frequently exceeding serverless execution timeouts. Overhauled the backend to trigger a single Gemini 1.5 Flash call for raw analysis (acting as a "shared brain") and executing the three specialist agents concurrently via Promise.all, reducing total processing time to under 12 seconds.
Distributed Rate Limiting: Implemented sliding-window rate limiters scoped via Upstash Redis. Distinguishes between quick database reads (200 requests/15 mins) and AI-heavy report generations (10 requests/hour), protecting the platform from DDoS token draining.
Validation Schema: Implementing strict validation checks at API boundaries from day one using shared Zod schemas would have prevented manual database schema repairs during active user cycles.
Eliminated token exposure in query parameters (which could be leaked in server log databases or third-party headers). Intercepts WebView loading requests to inject session authentication tokens safely via Request Headers to a server-side redirect endpoint.
Migrates sensitive health data transparently from standard plaintext local storage to keychain storage encrypted using AES-256-GCM hardware modules, automatically wiping the insecure source on first access.
import * as SecureStore from 'expo-secure-store';
import AsyncStorage from '@react-native-async-storage/async-storage';
export async function getSecureData(key) {
const isMigrated = await AsyncStorage.getItem(`migrated_${key}`);
if (!isMigrated) {
const legacyValue = await AsyncStorage.getItem(key);
if (legacyValue) {
await SecureStore.setItemAsync(key, legacyValue);
await AsyncStorage.removeItem(key); // Clear plaintext
await AsyncStorage.setItem(`migrated_${key}`, 'true');
return legacyValue;
}
}
return await SecureStore.getItemAsync(key);
}
Asynchronous Multi-Agent AI Pipeline
Runs background clinical and psychological wellness report compilation via multi-agent flows to bypass Serverless function execution limits. Utilizes a strict 24-hour database caching gate to prevent runaway API fees.
// Next.js Serverless Route with Cache Control
export async function POST(req) {
const { userId, force } = await req.json();
if (!force) {
const cachedReport = await prisma.wellnessReport.findFirst({
where: {
userId,
createdAt: { gte: new Date(Date.now() - 24 * 60 * 60 * 1000) }
}
});
if (cachedReport) return NextResponse.json(cachedReport);
}
const newReport = await runCrewAIPipeline(userId);
return NextResponse.json(newReport);
}
Recursive Telemetry Log Sanitizer
Prevents telemetry leak of user-sensitive data (PII) or secrets. Centralizes app logs and recursively scans object structures, comparing key names against a redaction registry before transmission.
const REDACTED_KEYS = ["token", "email", "medicalConditions", "password", "Authorization"];
export function redactObject(obj) {
if (typeof obj !== 'object' || obj === null) return obj;
if (Array.isArray(obj)) return obj.map(redactObject);
const res = {};
for (const key in obj) {
if (REDACTED_KEYS.includes(key)) {
res[key] = key === "email" ? "[REDACTED_EMAIL]" : "[REDACTED_PII]";
} else {
res[key] = redactObject(obj[key]);
}
}
return res;
}
Idempotent Webhook Verification
Protects the server from webhook duplication attacks or network replay attempts. Validates signatures using SHA-256 HMAC and runs payments idempotently inside isolated database transactions.
Prevents memory leaks and CPU throttle crashes on client devices running loops (like breathing guides and audio playback) by executing explicit cancellation cleanups when components unmount.